Skip to content

Conversation

@haardikk21
Copy link
Contributor

@haardikk21 haardikk21 commented Nov 3, 2025

Introduces a shared integration test framework in crates/test-utils and migrates the existing flashblocks RPC tests to use this new infrastructure. This framework supports tests that need to advance the state of the chain via flashblocks or full blocks to verify behavior.

  • TestHarness: The main orchestration layer that combines node management, Engine API interactions, and account management. It handles block building, chain advancement, and flashblocks submission.
  • LocalNode: An in-process Optimism node wrapper with Base Sepolia configuration, isolated from P2P discovery for parallel testing.
  • EngineApi: A wrapper around the Consensus Layer (CL) Engine API for forkchoice updates and payload submission.
  • TestAccounts: Pre-funded, deterministic accounts (Alice, Bob, Charlie, Deployer) compatible with Anvil defaults.

Closes #162 and #164.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Nov 3, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@steph-rs steph-rs mentioned this pull request Nov 12, 2025
1 task
@niran niran marked this pull request as ready for review November 20, 2025 04:01
@niran niran requested a review from danyalprout November 20, 2025 04:40
haardikk21 and others added 21 commits November 22, 2025 19:04
- Add latest_block() method to TestHarness in test-utils that encapsulates
  the two-step process of getting best_block_number then fetching that block
- Refactor test_progress_canonical_blocks_without_flashblocks to use the new method
- Refactor FlashblockBuilder::build() to use the new method
- Reduces code duplication and improves maintainability across all tests
Replace NodeBuilder::testing_node() with LocalNode::create_test_database()
to reduce memory usage in parallel tests. The testing_node() helper
hardcodes an 8 TB map size which causes ENOMEM errors when running
multiple test processes concurrently with cargo test.

This prevents memory exhaustion when running parallel tests while
maintaining the same functionality.
…er pattern

- Add missing max_pending_blocks_depth parameter (5) to FlashblocksState::new() calls in rpc.rs tests
- Add missing max_pending_blocks_depth parameter to init_flashblocks_state in test-utils
- Fix builder pattern to use engine_api_launcher() + launch_with() instead of .launch() to match TestHarness::new() signature
- Enable 'client' feature for reth-optimism-rpc dependency to fix OpEngineApiClient import error

These changes ensure no logic was lost during the rebase and fix compilation errors.
@haardikk21
Copy link
Contributor Author

haardikk21 commented Nov 26, 2025

LGTM - thanks a lot! I can't do an approval since I opened this PR

cc @danyalprout

@haardikk21 haardikk21 merged commit e8e00a8 into main Nov 26, 2025
9 checks passed
@haardikk21 haardikk21 deleted the refactor-tests branch November 26, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants